package com.dupf.product.dao.smodel;

import com.dupf.common.util.ItvJsonUtil;
import com.dupf.product.dao.model.ProductCategory;

import java.io.Serializable;

public class ProductCategorySpe implements Serializable {
    /**
     * 编号
     *
     * @mbg.generated
     */
    private Integer id;

    /**
     * 上级类别
     *
     * @mbg.generated
     */
    private Integer pid;

    /**
     * 名称
     *
     * @mbg.generated
     */
    private String name;

    /**
     * 英文名称
     *
     * @mbg.generated
     */
    private String title;

    /**
     * 级别
     *
     * @mbg.generated
     */
    private Byte level;

    /**
     * 子类数
     *
     * @mbg.generated
     */
    private Integer subnum;

    /**
     * 编码
     *
     * @mbg.generated
     */
    private String code;

    /**
     * 编码
     *
     * @mbg.generated
     */
    private String last;

    private ProductCategorySpe subCategory;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Byte getLevel() {
        return level;
    }

    public void setLevel(Byte level) {
        this.level = level;
    }

    public Integer getSubnum() {
        return subnum;
    }

    public void setSubnum(Integer subnum) {
        this.subnum = subnum;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getLast() {
        return last;
    }

    public void setLast(String last) {
        this.last = last;
    }

    public ProductCategorySpe getSubCategory() {
        return subCategory;
    }

    public void setSubCategory(ProductCategorySpe subCategory) {
        this.subCategory = subCategory;
    }

    @Override
    public String toString() {
        return ItvJsonUtil.writeValue(this);
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ProductCategorySpe other = (ProductCategorySpe) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getSubnum() == null ? other.getSubnum() == null : this.getSubnum().equals(other.getSubnum()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getLast() == null ? other.getLast() == null : this.getLast().equals(other.getLast()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getSubnum() == null) ? 0 : getSubnum().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getLast() == null) ? 0 : getLast().hashCode());
        return result;
    }
}